package com.woniu.servicepay.service;

import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import com.woniu.servicepay.config.AlipayConfig;
import com.woniu.servicepay.service.impl.AlipayServiceImpl;
import com.woniu.servicepay.util.PaymentWebSocketHandler;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.log4j.Log4j2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

public interface AlipayService {
    /**
     * 预下单
     *
     * @param subject     订单标题
     * @param outTradeNo  商家生成的订单号
     * @param totalAmount 订单总价值
     * @return
     */
    String appPay(String subject, String outTradeNo, String totalAmount);

    /**
     * 回调业务处理
     * @param request
     * @return
     */
    String orderNotify(HttpServletRequest request);

}
